package com.baizhiedu.baizhiappsys.dao.impl;

import com.baizhiedu.baizhiappsys.dao.AdminDao;
import com.baizhiedu.baizhiappsys.entity.AdminAccount;
import com.baizhiedu.baizhiappsys.orm.AdminAccountRowMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author lby
 */
@Repository
public class AdminDaoImpl implements AdminDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public AdminAccount selectByUsername(String username) {
        // 条件查询
        String sql = "select * from t_admin_account where admin_username = ?";
        AdminAccount adminAccount = jdbcTemplate.queryForObject(sql, new AdminAccountRowMapper(), username);
        return adminAccount;
    }
}
